"""
Base repository scanner.
"""
import logging

def execute_processing(processors, conf, processor):
    """
    Executes processing.
    """
    processor.process()
    if len(processor.changes) > 0:
        logging.info(str(len(processor.changes)) + \
                      " changes found in repository " + conf['location'])
    else:
        logging.info("No new changes found in repository " + \
                     conf['location'])
    processors.append(processor)


class RepositoryScanner: #pylint: disable-msg=R0903
    '''
    Base class for all repository scanners.
    '''
    def __init__(self, settings, storepath, oldpath, reponame):
        """
        Creates repository.
        
        settings: configuration settings object
        storepath: path where processed ids are stored
        oldpath: path where previous ids are stored
        reponame: name of the repository
        """
        self._settings = settings
        self._storepath = storepath
        self._oldpath = oldpath
        self._reponame = reponame
        
    def scan_repo(self, processors, conf):
        """
        Scans repository and add processors that are found (might be more than
        one.
        """
        raise NotImplementedError()

